from django.urls import path
from rest_framework.routers import SimpleRouter
from .views import ClassesViewSet, ClassMemberViewSet
from rest_framework.routers import DefaultRouter  # 默认路由，他与简单路由有差异
urlpatterns = [
    path('classes/<pk>/member/', ClassMemberViewSet.as_view({'post': 'add_member'}))
]
router = DefaultRouter()  # 实例化一个默认路由器对象
router.register('classes', ClassesViewSet)
urlpatterns += router.urls
